package ad6;

import java.beans.XMLEncoder;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.*;

public class ObjToXML {

	public static void main(String[] args) throws IOException {
		// 一步秒杀
		// 无参的公共构造方法,set/get

		List<Student> list = new ArrayList<Student>();
		list.add(new Student("妖", "小旋风", "黑风岭学院", new Date(70, 2, 4)));
		list.add(new Student("男", "猪八戒", "高老庄学校", new Date(70, 2, 4)));
		list.add(new Student("女", "高翠兰", "高老庄学院", new Date(70, 2, 4)));
		list.add(new Student("男", "巨灵神", "天庭大学", new Date(70, 2, 4)));

		XMLEncoder xd = new XMLEncoder(new FileOutputStream("west.xml"));
		xd.writeObject(list);
		xd.close();

	}
}
